import request from '@/utils/request.js'

// 保存文章
export const SaveArticle = data => {
    return request({
        url: '/member/article/saveArticle',
        method: 'post',
        data,
    })
}

// 保存文章
export const SaveArticleDraft = data => {
    return request({
        url: '/member/article/saveArticleDraft',
        method: 'post',
        data,
    })
}

// 查询用户所有已发表的文章
export const ListArticleByUserId = userId => {
    return request({
        url: '/member/article/listArticleByUserId/' + userId,
        method: 'get',
    })
}

// 查询用户所有文章草稿
export const ListArticleDraftByUserId = userId => {
    return request({
        url: '/member/article/listArticleDraftByUserId/' + userId,
        method: 'get',
    })
}

// 查询文章
export const ListArticleById = (params) => {
    return request({
        url: '/member/article/listArticleById',
        method: 'get',
        params,
    })
}

// 查询所有文章
export const ListArticleAll = () => {
    return request({
        url: '/member/article/listArticleAll',
        method: 'get',
    })
}


// 点赞文章
export const LikeArticle = (params) => {
    return request({
        url: '/member/article/likeArticle',
        method: 'get',
        params,
    })
}





